package yh.thread.threadservice;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @author: zyh
 * @date: 2024/11/1 12:11
 **/
@Service
public class ThreadTaskService {


    @Async
    public void excuteTask(String taskName){
        System.out.println(Thread.currentThread().getName() + "线程正在执行" + taskName);
    }


    @Async
    public void excuteTaskException(String taskName){
        System.out.println(Thread.currentThread().getName() + "线程正在执行" + taskName);
        int i= 1/0;

    }
}
